﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo00
{
    class Program
    {
        static void Main(string[] args)
        {
            //输入一行字符串，分别统计出其中英文字母、数字、空格的个数。
            Console.WriteLine("请输入一行字符串");
            string str = Console.ReadLine();

            int countletter = 0;
            int countnumber = 0;
            int countwhitespace = 0;
            foreach (var c in str)
            {
                if (char.IsLetter(c))
                {
                    countletter++;
                }
                else if (char.IsNumber(c))
                {
                    countnumber++;
                }
                else if (char.IsWhiteSpace(c))
                {
                    countwhitespace++;
                }
            }
            Console.WriteLine("输入的字符串中，字母有{0}个，数字有{1}个，空格有{3}个", countletter, countnumber, countwhitespace);

       }
    }
}
